package com.slliver.sentinelservice.config;


import com.alibaba.cloud.sentinel.SentinelProperties;
import com.alibaba.cloud.sentinel.custom.SentinelAutoConfiguration;
import com.slliver.sentinelservice.handler.SentinelNacosDataSourceHandler;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * sentinel配置持久化到nacos
 */
//@Configuration(proxyBeanMethods = false)
//@AutoConfigureAfter(SentinelAutoConfiguration.class)
public class SentinelNacosDataSourceConfig {


    @Bean
    @ConditionalOnMissingBean
    public SentinelNacosDataSourceHandler sentinelNacosDataSourceHandler(SentinelProperties sentinelProperties){
        return new SentinelNacosDataSourceHandler(sentinelProperties);
    }
}
